﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Aioms.Dtos;
using Aioms.Models;
using Mapster;

namespace Aioms.Mapper
{
    public class WeiXiuGongDanListExportMapper : IRegister
    {
        public void Register(TypeAdapterConfig config)
        {
            Dictionary<int, string> level = new() { {1, "轻微"},{2, "一般" },{3, "紧急" } };
            config.ForType<NrWorkOrder, WeiXiuGongDanListExportDto>()
                .Map(wxgdle => wxgdle.Names, wo => wo.EpRealnames)
                .Map(wxgdle => wxgdle.Rpnumber, wo => wo.NoticeRepair.RpNumber)
                .Map(wxgdle => wxgdle.Dvname, wo => wo.NoticeRepair.Dvname)
                .Map(wxgdle => wxgdle.Number, wo => wo.NoticeRepair.Dvnumber)
                .Map(wxgdle => wxgdle.Specification, wo => wo.NoticeRepair.Specification)
                .Map(wxgdle => wxgdle.Position, wo => wo.NoticeRepair.Position)
                .Map(wxgdle => wxgdle.Level, wo => level[wo.NoticeRepair.Level])
                .Map(wxgdle => wxgdle.TroubleTime, wo => wo.NoticeRepair.TroubleTime)
                .Map(wxgdle => wxgdle.Description, wo => wo.NoticeRepair.Description)
                .Map(wxgdle => wxgdle.BeginTime, wo => wo.SjBeginTime)
                .Map(wxgdle => wxgdle.EndTime, wo => wo.SjEndTime)
                .Map(wxgdle => wxgdle.ManHour, wo => wo.SjManHour)
                .Map(wxgdle => wxgdle.Result, wo => wo.SjResult)
                .Map(wxgdle => wxgdle.Procedure, wo => wo.SjProcedure)
                .Map(wxgdle => wxgdle.Status, wo => wo.Status);
        }
    }
}
